<?php

namespace app\models\role;

use Yii;

/**
 * This is the model class for table "role".
 *
 * @property int $id
 * @property string $name
 * @property int $can_delete 是否可以删除 1 可以 0 不可以
 */
class Role extends \yii\db\ActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return 'role';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['can_delete'], 'integer'],
            [['name'], 'string', 'max' => 255],
            [['name'], 'unique', 'message' => '名称重复'],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'name' => 'Name',
            'can_delete' => 'Can Delete',
        ];
    }


}
